package com.usian.scheduled;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

import java.util.Date;

@Component
public class ScheduledTest {

    private final static Logger logger = LoggerFactory.getLogger(ScheduledTest.class);

    @Scheduled(cron = "0/2 * * * * ?")
    public void test(){
        logger.info("定时执行：====="+new Date());
    }
}
